package com.wuye.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.wuye.common.services.impl.BaseManagerImpl;
import com.wuye.common.vo.ZTreeInfo;
import com.wuye.dao.AreaDao;
import com.wuye.entity.Area;
import com.wuye.services.AreaServiceManager;

@Service("areaServiceManager")
public class AreaServiceManagerImpl extends BaseManagerImpl implements AreaServiceManager
{
	@Autowired
	private AreaDao areaDao;
	
	public List<Area> getAreas(int upAreaId)
	{
		return areaDao.getAreas(upAreaId);
	}
	
	public Area getArea(int areaId) throws Exception
	{
		return areaDao.getArea(areaId);
	}

	public List<ZTreeInfo> getAreaInfos(List<Integer> openAreaIds)
	{
		return areaDao.getAreaInfos(openAreaIds);
	}

	public void addArea(Area area) throws Exception 
	{
		areaDao.addArea(area);		
	}

	public void updateArea(Area area) throws Exception
	{
		areaDao.updateArea(area);
	}

	public void delArea(int areaId) throws Exception 
	{
		areaDao.delArea(areaId);
	}
	
	public String getParents(int id)
	{
		return areaDao.getParents(id);
	}

}
